﻿


$(document).ready(function () {
    //修改密码
    $("#changePass").click(function () {
        var oldpass = $("#OldPass").val();
        var newpass = $("#NewPass").val();
        var newconfirmpass = $("#NewConfirmPass").val();

        if (oldpass == "") {
            $("#msg").innerHTML = "原始密码不能为空！";
            return false;
        }

        if (newpass == "") {
            $("#newpassmsg").innerHTML = "新密码不能为空！";
            return false;
        }

        if (newconfirmpass != newpass) {
            $("#newconfirmpassmsg").innerHTML = "确认密码和新密码不相符！";
            return false;
        }

        var flag = RuiZhiSZSLSystem.Web.Member.ChangePassword.ChangePWD(oldpass, newpass, newconfirmpass).vlaue;
        if (flag) {
            $("#msg").innerHTML = "密码修改成功，下次登录使用新密码登录。";
        }
        else {
            $("#msg").innerHTML = "密码修改失败，请确认原始密码是否正确。";
        }
    });


    
});


//获取会员信息
function GetUserDetail() {
    var userInfo = RuiZhiSZSLSystem.Web.Member.UserDetail.UserDetail().value;
    if (userInfo != null) {
        userInfo = HashToArray(userInfo);
        $("#NikeName").val(userInfo["NikeName"]);
        $("#RealName").val(userInfo["RealName"]);
        if (userInfo["Sex"] == 1) {
            $("#man").checked = true;
        }
        else if (userInfo["Sex"] == 2) {
            $("#woman").checked = true;
        }
        $("#Province").val(userInfo["Province"]);
        $("#City").val(userInfo["City"]);
        $("#address").val(userInfo["address"]);
        $("#telphone").val(userInfo["telphone"]);
        $("#checkEmail").val(userInfo["checkEmail"]);
        $("#NikeName").val(userInfo["NikeName"]);
        $("#textarea1").val(userInfo["textarea1"]);
        $("#textarea2").val(userInfo["textarea2"]);
    }
};

